import 'package:get/get.dart';
import 'package:logger/logger.dart';
import 'package:lovify/core/network/model/response_entity.dart';
import 'package:lovify/core/utils/toast.dart';


class BaseController extends GetxController {

  final Logger _logger = Logger(printer: PrettyPrinter());

  void showMsg(dynamic target) {
    _logger.i(target);
    Toast.show(message: target.toString());
  }

  bool checkResponse<T>(ResponseEntity<T> resp) {
    if (resp.statusCode != 200) {
      showMsg(resp.statusMessage);
      return false;
    }
    if (resp.data == null) {
      return false;
    }
    return true;
  }

}
